-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Paddle Inference] Memory Optimize destruct argument #49046
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
} else { | ||
argument_.reset(nullptr); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的释放操作需要确认一下,analysis_argument()主要用于测试,获取fusion_statis字段检测fuse op数量。 需确认这些单测是否有效。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为了降内存,几乎把这些测试都删掉了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
Others
Describe
pass 阶段 argument 会保存网络信息,pass 结束后未析构导致内存增加,推理 pass 阶段完成后,不会再使用 argument ,遂将其变成智能指针手动释放。
修改 analysis 相关单测,删除单测中调用 predictor->analysis_argument() 接口获取 fused 后节点信息。
这样 pass 优化结束后 predictor->analysis_argument() 接口会被释放无法再被调用,目前 analysis_argument()接口调用多用于调试,mkldnn_int8 会继续调用所以 不在mkldnn下释放。